#include "Sentences.h"

istream& operator>>(istream& from, Sentences& s){
	unsigned int size;
	char c;
	from >> size;
	for( unsigned int i = 0; i < size; i++){
		from.get(c);
		string str = getLine(from);
		Sentences::iterator current = s.insert(s.lower_bound(str), Sentences::value_type(str, Sentence()));
		current->second.text = &current->first;
		from >> current->second;
		from.get(c);
	}
	return from;
}

ostream& operator<<(ostream& os, const Sentences& s){
	os << s.size() << "\n";
	for( Sentences::const_iterator i = s.begin(); i != s.end(); i++ ){
		os << i->first << "\n" << i->second << "\n";
	}
	return  os;
}